package com.liuwei.msmall.product.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Classname RedissonConfig
 * @Date 2021/4/20 16:55
 * @Created by 刘
 */
@Configuration
public class RedissonConfig {


    @Bean
    public RedissonClient redissonClient(){
        // 1. Create config object
        Config config = new Config();
        config.useSingleServer().setAddress("redis://47.99.141.196:6379").setPassword("liuwei@123");
        RedissonClient redisson = Redisson.create(config);
        return redisson;
    }

}

